home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / ada_lrm1.zip / CHAPA.DOC next >
Text File  |  1988-11-30  |  27KB  |  992 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. The following document is a draft  of  the  corresponding  chapter  of  the
  7. version  of  the  Ada  Reference  Manual  produced  in response to the Ansi
  8. Canvass.  It is given a limited circulation  to  Ada  implementers  and  to
  9. other groups contributing comments (according to the conventions defined in
  10. RRM.comments).  This draft should not be referred to in any publication.
  11.  
  12.  
  13.  
  14.                        ANSI-RM-A-v23 - Draft Chapter
  15.  
  16.                      A  Predefined Language Attributes
  17.                                 version 23
  18.  
  19.                                  83-02-11
  20.  
  21.  
  22. This revision has considered all comments up to #5795
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.                      A. Predefined Language Attributes
  78.  
  79.  
  80.  
  81. This  annex  summarizes  the  definitions given elsewhere of the predefined
  82. language attributes.
  83.  
  84.  
  85.  
  86. P'ADDRESS         For a prefix P that denotes an object, a program unit,  a
  87.                   label, or an entry:
  88.  
  89.                   Yields  the  address  of  the  first of the storage units
  90.                   allocated to P.  For a subprogram, package, task unit, or
  91.                   label, this value refers to the machine  code  associated
  92.                   with  the  corresponding body or statement.  For an entry
  93.                   for which an address clause has  been  given,  the  value
  94.                   refers  to  the  corresponding  hardware  interrupt.  The
  95.                   value of this attribute is of the type ADDRESS defined in
  96.                   the package SYSTEM.  (See 13.7.2.)
  97.  
  98. P'AFT             For a prefix P that denotes a fixed point subtype:
  99.  
  100.                   Yields the number of  decimal  digits  needed  after  the
  101.                   point  to  accommodate  the  precision  of the subtype P,
  102.                   unless the delta of the subtype P is greater than 0.1, in
  103.                   which case the attribute yields the value one.  (P'AFT is
  104.                   the smallest positive integer N for which (10**N)*P'DELTA
  105.                   is greater than or equal to  one.)   The  value  of  this
  106.                   attribute   is   of  the  type  universal_integer.   (See
  107.                   3.5.10.)
  108.  
  109. P'BASE            For a prefix P that denotes a type or subtype:
  110.  
  111.                   This attribute denotes the base type of P.   It  is  only
  112.                   allowed  as  the prefix of the name of another attribute:
  113.                   for example, P'BASE'FIRST.  (See 3.3.3.)
  114.  
  115. P'CALLABLE        For a prefix P that is appropriate for a task type:
  116.  
  117.                   Yields the value FALSE when the execution of the  task  P
  118.                   is  either  completed  or terminated, or when the task is
  119.                   abnormal;  yields the value TRUE otherwise.  The value of
  120.                   this attribute is of the predefined type  BOOLEAN.   (See
  121.                   9.9.)
  122.  
  123. P'CONSTRAINED     For a prefix P that denotes an  object  of  a  type  with
  124.                   discriminants:
  125.  
  126.  
  127.  
  128.  
  129.                                    A - 1
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.                   Yields  the  value  TRUE  if  a  discriminant  constraint
  139.                   applies to the object P, or if the object is  a  constant
  140.                   (including a formal parameter or generic formal parameter
  141.                   of  mode in);  yields the value FALSE otherwise.  If P is
  142.                   a generic formal parameter of mode in out, or if P  is  a
  143.                   formal  parameter of mode in out or out and the type mark
  144.                   given  in  the  corresponding   parameter   specification
  145.                   denotes  an  unconstrained  type with discriminants, then
  146.                   the value of this attribute is obtained from that of  the
  147.                   corresponding   actual  parameter.   The  value  of  this
  148.                   attribute  is  of  the  predefined  type  BOOLEAN.   (See
  149.                   3.7.4.)
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                    A - 2
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204. P'CONSTRAINED     For a prefix P that denotes a private type or subtype:
  205.  
  206.                   Yields  the  value  FALSE  if  P denotes an unconstrained
  207.                   nonformal private type with discriminants;   also  yields
  208.                   the  value  FALSE  if  P denotes a generic formal private
  209.                   type and the  associated  actual  subtype  is  either  an
  210.                   unconstrained type with discriminants or an unconstrained
  211.                   array  type;  yields the value TRUE otherwise.  The value
  212.                   of this attribute is  of  the  predefined  type  BOOLEAN.
  213.                   (See 7.4.2.)
  214.                    1
  215.  
  216. P'COUNT           For a prefix P that denotes an entry of a task unit:
  217.  
  218.                   Yields  the number of entry calls presently queued on the
  219.                   entry (if the attribute is  evaluated  within  an  accept
  220.                   statement for the entry P, the count does not include the
  221.                   calling  task).   The  value  of this attribute is of the
  222.                   type universal_integer.  (See 9.9.)
  223.  
  224. P'DELTA           For a prefix P that denotes a fixed point  subtype:
  225.  
  226.                   Yields the value of the  delta  specified  in  the  fixed
  227.                   accuracy definition for the subtype P.  The value of this
  228.                   attribute  is  of the type universal_real.  (See 3.5.10.)
  229.  
  230. P'DIGITS          For a prefix P that denotes a floating point subtype:
  231.  
  232.                   Yields the  number  of  decimal  digits  in  the  decimal
  233.                   mantissa  of  model  numbers  of  the  subtype  P.  (This
  234.                   attribute yields the number D  of  section  3.5.7.)   The
  235.                   value of this attribute is of the type universal_integer.
  236.                   (See 3.5.8.)
  237.  
  238. P'EMAX            For a prefix P that denotes a floating point  subtype:
  239.  
  240.                   Yields the largest exponent value in the binary canonical
  241.                   form  of model numbers of the subtype P.  (This attribute
  242.                   yields the product 4*B of section 3.5.7.)  The  value  of
  243.                   this  attribute  is  of the type universal_integer.  (See
  244.                   3.5.8.)
  245.  
  246. P'EPSILON         For a prefix P that denotes a floating point subtype:
  247.  
  248.                   Yields the absolute value of the difference  between  the
  249.                   model number 1.0 and the next model number above, for the
  250.                   subtype  P.   The  value of this attribute is of the type
  251.                   universal_real.  (See 3.5.8.)
  252.  
  253. P'FIRST           For a prefix P that denotes a scalar type, or  a  subtype
  254.                   of a scalar type:
  255.  
  256.                   Yields the lower bound of P.  The value of this attribute
  257.                   has the same type as P.  (See 3.5.)
  258.  
  259.  
  260.  
  261.                                    A - 3
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270. P'FIRST           For a prefix P that is appropriate for an array type,  or
  271.                   that denotes a constrained array subtype:
  272.  
  273.                   Yields  the  lower  bound  of the first index range.  The
  274.                   value of this attribute has the same type as  this  lower
  275.                   bound.  (See 3.6.2 and 3.8.2.)
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                    A - 4
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. P'FIRST(N)        For a prefix P that is appropriate for an array type,  or
  337.                   that denotes a constrained array subtype:
  338.  
  339.                   Yields  the  lower  bound  of  the N-th index range.  The
  340.                   value of this attribute has the same type as  this  lower
  341.                   bound.   The  argument  N  must be a static expression of
  342.                   type universal_integer.  The value of N must be  positive
  343.                   (nonzero)  and  no greater than the dimensionality of the
  344.                   array.  (See 3.6.2 and 3.8.2.)
  345.  
  346. P'FIRST_BIT